﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using Styx.Common;
using Styx;

using HS = Hunter.CRSettings.CRSettings;
using HKM = Hunter.Helpers.HotkeyManager;

namespace Hunter.GUI
{
    public partial class Form1 : Form
    {
        private static int pauseSelect;
        private static int stopAoeSelect;
        private static int manualSelect;
        private static int cooldownSelect;
        private static string comboSelectPause;
        private static string comboSelectAoe;
        private static string comboSelectManual;
        private static string comboSelectCooldown;

        public Form1()
        {
            InitializeComponent();
        }




        private void button1_Click(object sender, EventArgs e)
        {
            HKM.keysRegistered = false;
            HKM.registerHotKeys();
            HS.myPrefs.Save();
            Close();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            if (File.Exists(Utilities.AssemblyDirectory +
                            @"\Routines\Hunter\Images\bg.png"))
            {
                pictureBox1.ImageLocation = Utilities.AssemblyDirectory +
                                            @"\Routines\Hunter\Images\bg.png";
            }

            comboSelectPause = HS.myPrefs.KeyPauseCR.ToString();
            switch (comboSelectPause)
            {
                case "None":
                    comboBoxSelectPause.SelectedIndex = 0;
                    break;
                case "A":
                    comboBoxSelectPause.SelectedIndex = 1;
                    break;
                case "B":
                    comboBoxSelectPause.SelectedIndex = 2;
                    break;
                case "C":
                    comboBoxSelectPause.SelectedIndex = 3;
                    break;
                case "D":
                    comboBoxSelectPause.SelectedIndex = 4;
                    break;
                case "E":
                    comboBoxSelectPause.SelectedIndex = 5;
                    break;
                case "F":
                    comboBoxSelectPause.SelectedIndex = 6;
                    break;
                case "G":
                    comboBoxSelectPause.SelectedIndex = 7;
                    break;
                case "H":
                    comboBoxSelectPause.SelectedIndex = 8;
                    break;
                case "I":
                    comboBoxSelectPause.SelectedIndex = 9;
                    break;
                case "J":
                    comboBoxSelectPause.SelectedIndex = 10;
                    break;
                case "K":
                    comboBoxSelectPause.SelectedIndex = 11;
                    break;
                case "L":
                    comboBoxSelectPause.SelectedIndex = 12;
                    break;
                case "M":
                    comboBoxSelectPause.SelectedIndex = 13;
                    break;
                case "N":
                    comboBoxSelectPause.SelectedIndex = 14;
                    break;
                case "O":
                    comboBoxSelectPause.SelectedIndex = 15;
                    break;
                case "P":
                    comboBoxSelectPause.SelectedIndex = 16;
                    break;
                case "Q":
                    comboBoxSelectPause.SelectedIndex = 17;
                    break;
                case "R":
                    comboBoxSelectPause.SelectedIndex = 18;
                    break;
                case "S":
                    comboBoxSelectPause.SelectedIndex = 19;
                    break;
                case "T":
                    comboBoxSelectPause.SelectedIndex = 20;
                    break;
                case "U":
                    comboBoxSelectPause.SelectedIndex = 21;
                    break;
                case "V":
                    comboBoxSelectPause.SelectedIndex = 22;
                    break;
                case "W":
                    comboBoxSelectPause.SelectedIndex = 23;
                    break;
                case "X":
                    comboBoxSelectPause.SelectedIndex = 24;
                    break;
                case "Y":
                    comboBoxSelectPause.SelectedIndex = 25;
                    break;
                case "Z":
                    comboBoxSelectPause.SelectedIndex = 26;
                    break;
            }
            comboSelectAoe = HS.myPrefs.KeyStopAoe.ToString();
            switch (comboSelectAoe)
            {
                case "None":
                    comboBoxSelectAoe.SelectedIndex = 0;
                    break;
                case "A":
                    comboBoxSelectAoe.SelectedIndex = 1;
                    break;
                case "B":
                    comboBoxSelectAoe.SelectedIndex = 2;
                    break;
                case "C":
                    comboBoxSelectAoe.SelectedIndex = 3;
                    break;
                case "D":
                    comboBoxSelectAoe.SelectedIndex = 4;
                    break;
                case "E":
                    comboBoxSelectAoe.SelectedIndex = 5;
                    break;
                case "F":
                    comboBoxSelectAoe.SelectedIndex = 6;
                    break;
                case "G":
                    comboBoxSelectAoe.SelectedIndex = 7;
                    break;
                case "H":
                    comboBoxSelectAoe.SelectedIndex = 8;
                    break;
                case "I":
                    comboBoxSelectAoe.SelectedIndex = 9;
                    break;
                case "J":
                    comboBoxSelectAoe.SelectedIndex = 10;
                    break;
                case "K":
                    comboBoxSelectAoe.SelectedIndex = 11;
                    break;
                case "L":
                    comboBoxSelectAoe.SelectedIndex = 12;
                    break;
                case "M":
                    comboBoxSelectAoe.SelectedIndex = 13;
                    break;
                case "N":
                    comboBoxSelectAoe.SelectedIndex = 14;
                    break;
                case "O":
                    comboBoxSelectAoe.SelectedIndex = 15;
                    break;
                case "P":
                    comboBoxSelectAoe.SelectedIndex = 16;
                    break;
                case "Q":
                    comboBoxSelectAoe.SelectedIndex = 17;
                    break;
                case "R":
                    comboBoxSelectAoe.SelectedIndex = 18;
                    break;
                case "S":
                    comboBoxSelectAoe.SelectedIndex = 19;
                    break;
                case "T":
                    comboBoxSelectAoe.SelectedIndex = 20;
                    break;
                case "U":
                    comboBoxSelectAoe.SelectedIndex = 21;
                    break;
                case "V":
                    comboBoxSelectAoe.SelectedIndex = 22;
                    break;
                case "W":
                    comboBoxSelectAoe.SelectedIndex = 23;
                    break;
                case "X":
                    comboBoxSelectAoe.SelectedIndex = 24;
                    break;
                case "Y":
                    comboBoxSelectAoe.SelectedIndex = 25;
                    break;
                case "Z":
                    comboBoxSelectAoe.SelectedIndex = 26;
                    break;
            }
            comboSelectCooldown = HS.myPrefs.KeyUseCooldowns.ToString();
            switch (comboSelectCooldown)
            {
                case "None":
                    comboBoxSelectCooldown.SelectedIndex = 0;
                    break;
                case "A":
                    comboBoxSelectCooldown.SelectedIndex = 1;
                    break;
                case "B":
                    comboBoxSelectCooldown.SelectedIndex = 2;
                    break;
                case "C":
                    comboBoxSelectCooldown.SelectedIndex = 3;
                    break;
                case "D":
                    comboBoxSelectCooldown.SelectedIndex = 4;
                    break;
                case "E":
                    comboBoxSelectCooldown.SelectedIndex = 5;
                    break;
                case "F":
                    comboBoxSelectCooldown.SelectedIndex = 6;
                    break;
                case "G":
                    comboBoxSelectCooldown.SelectedIndex = 7;
                    break;
                case "H":
                    comboBoxSelectCooldown.SelectedIndex = 8;
                    break;
                case "I":
                    comboBoxSelectCooldown.SelectedIndex = 9;
                    break;
                case "J":
                    comboBoxSelectCooldown.SelectedIndex = 10;
                    break;
                case "K":
                    comboBoxSelectCooldown.SelectedIndex = 11;
                    break;
                case "L":
                    comboBoxSelectCooldown.SelectedIndex = 12;
                    break;
                case "M":
                    comboBoxSelectCooldown.SelectedIndex = 13;
                    break;
                case "N":
                    comboBoxSelectCooldown.SelectedIndex = 14;
                    break;
                case "O":
                    comboBoxSelectCooldown.SelectedIndex = 15;
                    break;
                case "P":
                    comboBoxSelectCooldown.SelectedIndex = 16;
                    break;
                case "Q":
                    comboBoxSelectCooldown.SelectedIndex = 17;
                    break;
                case "R":
                    comboBoxSelectCooldown.SelectedIndex = 18;
                    break;
                case "S":
                    comboBoxSelectCooldown.SelectedIndex = 19;
                    break;
                case "T":
                    comboBoxSelectCooldown.SelectedIndex = 20;
                    break;
                case "U":
                    comboBoxSelectCooldown.SelectedIndex = 21;
                    break;
                case "V":
                    comboBoxSelectCooldown.SelectedIndex = 22;
                    break;
                case "W":
                    comboBoxSelectCooldown.SelectedIndex = 23;
                    break;
                case "X":
                    comboBoxSelectCooldown.SelectedIndex = 24;
                    break;
                case "Y":
                    comboBoxSelectCooldown.SelectedIndex = 25;
                    break;
                case "Z":
                    comboBoxSelectCooldown.SelectedIndex = 26;
                    break;
            }
            comboSelectManual = HS.myPrefs.KeyPlayManual.ToString();
            switch (comboSelectManual)
            {
                case "None":
                    comboBoxPlayManual.SelectedIndex = 0;
                    break;
                case "A":
                    comboBoxPlayManual.SelectedIndex = 1;
                    break;
                case "B":
                    comboBoxPlayManual.SelectedIndex = 2;
                    break;
                case "C":
                    comboBoxPlayManual.SelectedIndex = 3;
                    break;
                case "D":
                    comboBoxPlayManual.SelectedIndex = 4;
                    break;
                case "E":
                    comboBoxPlayManual.SelectedIndex = 5;
                    break;
                case "F":
                    comboBoxPlayManual.SelectedIndex = 6;
                    break;
                case "G":
                    comboBoxPlayManual.SelectedIndex = 7;
                    break;
                case "H":
                    comboBoxPlayManual.SelectedIndex = 8;
                    break;
                case "I":
                    comboBoxPlayManual.SelectedIndex = 9;
                    break;
                case "J":
                    comboBoxPlayManual.SelectedIndex = 10;
                    break;
                case "K":
                    comboBoxPlayManual.SelectedIndex = 11;
                    break;
                case "L":
                    comboBoxPlayManual.SelectedIndex = 12;
                    break;
                case "M":
                    comboBoxPlayManual.SelectedIndex = 13;
                    break;
                case "N":
                    comboBoxPlayManual.SelectedIndex = 14;
                    break;
                case "O":
                    comboBoxPlayManual.SelectedIndex = 15;
                    break;
                case "P":
                    comboBoxPlayManual.SelectedIndex = 16;
                    break;
                case "Q":
                    comboBoxPlayManual.SelectedIndex = 17;
                    break;
                case "R":
                    comboBoxPlayManual.SelectedIndex = 18;
                    break;
                case "S":
                    comboBoxPlayManual.SelectedIndex = 19;
                    break;
                case "T":
                    comboBoxPlayManual.SelectedIndex = 20;
                    break;
                case "U":
                    comboBoxPlayManual.SelectedIndex = 21;
                    break;
                case "V":
                    comboBoxPlayManual.SelectedIndex = 22;
                    break;
                case "W":
                    comboBoxPlayManual.SelectedIndex = 23;
                    break;
                case "X":
                    comboBoxPlayManual.SelectedIndex = 24;
                    break;
                case "Y":
                    comboBoxPlayManual.SelectedIndex = 25;
                    break;
                case "Z":
                    comboBoxPlayManual.SelectedIndex = 26;
                    break;
            }




            if (HS.myPrefs.PetSolo == 1) { radioButtonSolo1.Checked = true; }
            if (HS.myPrefs.PetSolo == 2) { radioButtonSolo2.Checked = true; }
            if (HS.myPrefs.PetSolo == 3) { radioButtonSolo3.Checked = true; }
            if (HS.myPrefs.PetSolo == 4) { radioButtonSolo4.Checked = true; }
            if (HS.myPrefs.PetSolo == 5) { radioButtonSolo5.Checked = true; }
            if (HS.myPrefs.PetRaid == 1) { radioButtonRaid1.Checked = true; }
            if (HS.myPrefs.PetRaid == 2) { radioButtonRaid2.Checked = true; }
            if (HS.myPrefs.PetRaid == 3) { radioButtonRaid3.Checked = true; }
            if (HS.myPrefs.PetRaid == 4) { radioButtonRaid4.Checked = true; }
            if (HS.myPrefs.PetRaid == 5) { radioButtonRaid5.Checked = true; }
            if (HS.myPrefs.PetBG == 1) { radioButtonBG1.Checked = true; }
            if (HS.myPrefs.PetBG == 2) { radioButtonBG2.Checked = true; }
            if (HS.myPrefs.PetBG == 3) { radioButtonBG3.Checked = true; }
            if (HS.myPrefs.PetBG == 4) { radioButtonBG4.Checked = true; }
            if (HS.myPrefs.PetBG == 5) { radioButtonBG5.Checked = true; }
            if (HS.myPrefs.Gloves == 1) { radioButtonGlovesManual.Checked = true; }
            if (HS.myPrefs.Gloves == 2) { radioButtonGlovesCD.Checked = true; }
            if (HS.myPrefs.Misdirection == 1) { radioButton1.Checked = true; }
            if (HS.myPrefs.Misdirection == 2) { radioButton2.Checked = true; }
            if (HS.myPrefs.Misdirection == 3) { radioButton3.Checked = true; }
            if (HS.myPrefs.Misdirection == 4) { radioButton4.Checked = true; }
            if (HS.myPrefs.AgilityFlask == 1) { radioButton5.Checked = true; }
            if (HS.myPrefs.AgilityFlask == 2) { radioButton6.Checked = true; }
            if (HS.myPrefs.AgilityFlask == 3) { radioButton7.Checked = true; }
            if (HS.myPrefs.AgilityFlask == 4) { radioButton8.Checked = true; }
            if (HS.myPrefs.Trinket1 == 1) { radioButtonTrinket1Manual.Checked = true; }
            if (HS.myPrefs.Trinket1 == 2) { radioButtonTrinket1CD.Checked = true; }
            if (HS.myPrefs.Trinket1 == 3) { radioButtonTrinket1HP.Checked = true; }
            if (HS.myPrefs.Trinket2 == 1) { radioButtonTrinket2Manual.Checked = true; }
            if (HS.myPrefs.Trinket2 == 2) { radioButtonTrinket2CD.Checked = true; }
            if (HS.myPrefs.Trinket2 == 3) { radioButtonTrinket2HP.Checked = true; }

            numericUpDown1.Value = new decimal(HS.myPrefs.PercentMendPet);
            numericUpDown2.Value = new decimal(HS.myPrefs.PercentTrinket1HP);
            numericUpDown3.Value = new decimal(HS.myPrefs.PercentTrinket2HP);
            numericUpDown4.Value = new decimal(HS.myPrefs.PercentDeterrence);
            numericUpDown5.Value = new decimal(HS.myPrefs.PercentHealthstone);
            numericUpDown6.Value = new decimal(HS.myPrefs.PercentExhilaration);

            checkBox1.Checked = HS.myPrefs.AutoMovement;
            checkBox2.Checked = HS.myPrefs.AutoTargeting;
            checkBox3.Checked = HS.myPrefs.AutoFacing;
            checkBox4.Checked = HS.myPrefs.AutoMovementDisable;
            checkBox5.Checked = HS.myPrefs.AutoTargetingDisable;
            checkBox6.Checked = HS.myPrefs.AutoFacingDisable;
            checkBox7.Checked = HS.myPrefs.AutoInterrupt;
            checkBox8.Checked = HS.myPrefs.CDStampede;
            checkBox9.Checked = HS.myPrefs.CDMurder;
            checkBox10.Checked = HS.myPrefs.CDTrinket1;
            checkBox11.Checked = HS.myPrefs.CDTrinket2;
            checkBox12.Checked = HS.myPrefs.CDGloves;
            checkBox13.Checked = HS.myPrefs.AutoRevivePet;
            checkBox14.Checked = HS.myPrefs.AutoPet;
            checkBox15.Checked = HS.myPrefs.AutoPetTarget;
            checkBox16.Checked = HS.myPrefs.PrintRaidstyleMsg;
            checkBox17.Checked = HS.myPrefs.FlaskCrystal;
            checkBox18.Checked = HS.myPrefs.FlaskAlchemy;
            checkBox19.Checked = HS.myPrefs.CDRacial;
            checkBox20.Checked = HS.myPrefs.Bloodfury;
            checkBox21.Checked = HS.myPrefs.Berserking;


        }

        private void radioButtonSolo1_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonSolo1.Checked) { HS.myPrefs.PetSolo = 1; }
        }

        private void radioButtonSolo2_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonSolo2.Checked) { HS.myPrefs.PetSolo = 2; }
        }

        private void radioButtonSolo3_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonSolo3.Checked) { HS.myPrefs.PetSolo = 3; }
        }

        private void radioButtonSolo4_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonSolo4.Checked) { HS.myPrefs.PetSolo = 4; }
        }

        private void radioButtonSolo5_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonSolo5.Checked) { HS.myPrefs.PetSolo = 5; }
        }

        private void radioButtonRaid1_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonRaid1.Checked) { HS.myPrefs.PetRaid = 1; }
        }

        private void radioButtonRaid2_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonRaid2.Checked) { HS.myPrefs.PetRaid = 2; }
        }

        private void radioButtonRaid3_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonRaid3.Checked) { HS.myPrefs.PetRaid = 3; }
        }

        private void radioButtonRaid4_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonRaid4.Checked) { HS.myPrefs.PetRaid = 4; }
        }

        private void radioButtonRaid5_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonRaid5.Checked) { HS.myPrefs.PetRaid = 5; }
        }

        private void radioButtonBG1_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonBG1.Checked) { HS.myPrefs.PetBG = 1; }
        }

        private void radioButtonBG2_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonBG2.Checked) { HS.myPrefs.PetBG = 2; }
        }

        private void radioButtonBG3_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonBG3.Checked) { HS.myPrefs.PetBG = 3; }
        }

        private void radioButtonBG4_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonBG4.Checked) { HS.myPrefs.PetBG = 4; }
        }

        private void radioButtonBG5_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonBG5.Checked) { HS.myPrefs.PetBG = 5; }
        }

        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            HS.myPrefs.PercentMendPet = (int)numericUpDown1.Value;
        }

        private void checkBox16_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.PrintRaidstyleMsg = checkBox16.Checked;
        }

        private void numericUpDown4_ValueChanged(object sender, EventArgs e)
        {
            HS.myPrefs.PercentDeterrence = (int)numericUpDown4.Value;
        }

        private void numericUpDown5_ValueChanged(object sender, EventArgs e)
        {
            HS.myPrefs.PercentHealthstone = (int)numericUpDown5.Value;
        }

        private void numericUpDown6_ValueChanged(object sender, EventArgs e)
        {
            HS.myPrefs.PercentExhilaration = (int)numericUpDown6.Value;
        }

        private void numericUpDown2_ValueChanged(object sender, EventArgs e)
        {
            HS.myPrefs.PercentTrinket1HP = (int)numericUpDown2.Value;
        }

        private void numericUpDown3_ValueChanged(object sender, EventArgs e)
        {
            HS.myPrefs.PercentTrinket2HP = (int)numericUpDown3.Value;
        }

        private void radioButtonGlovesManual_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonGlovesManual.Checked) { HS.myPrefs.Gloves = 1; }
        }

        private void radioButtonGlovesCD_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonGlovesCD.Checked) { HS.myPrefs.Gloves = 2; }
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton1.Checked) { HS.myPrefs.Misdirection = 1; }
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton2.Checked) { HS.myPrefs.Misdirection = 2; }
        }

        private void radioButton3_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton3.Checked) { HS.myPrefs.Misdirection = 3; }
        }

        private void radioButton4_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton4.Checked) { HS.myPrefs.Misdirection = 4; }
        }

        private void radioButton5_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton5.Checked) { HS.myPrefs.AgilityFlask = 1; }
        }

        private void radioButton6_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton6.Checked) { HS.myPrefs.AgilityFlask = 2; }
        }

        private void radioButton7_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton7.Checked) { HS.myPrefs.AgilityFlask = 3; }
        }

        private void radioButton8_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton8.Checked) { HS.myPrefs.AgilityFlask = 4; }
        }

        private void checkBox17_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.FlaskCrystal = checkBox17.Checked;
        }

        private void checkBox18_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.FlaskAlchemy = checkBox18.Checked;
        }

        private void checkBox13_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.AutoRevivePet = checkBox13.Checked;
        }

        private void checkBox15_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.AutoPetTarget = checkBox15.Checked;
        }

        private void checkBox8_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.CDStampede = checkBox8.Checked;
        }

        private void checkBox9_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.CDMurder = checkBox9.Checked;
        }

        private void checkBox10_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.CDTrinket1 = checkBox10.Checked;
        }

        private void checkBox11_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.CDTrinket2 = checkBox11.Checked;
        }

        private void checkBox12_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.CDGloves = checkBox12.Checked;
        }

        private void checkBox19_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.CDRacial = checkBox19.Checked;
        }

        private void checkBox14_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.AutoPet = checkBox14.Checked;
        }

        private void checkBox7_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.AutoInterrupt = checkBox7.Checked;
        }

        private void comboBoxSelectPause_SelectedIndexChanged(object sender, EventArgs e)
        {
            pauseSelect = comboBoxSelectPause.SelectedIndex;
            switch (pauseSelect)
            {
                case 0:
                    HS.myPrefs.KeyPauseCR = Keys.None;
                    break;
                case 1:
                    HS.myPrefs.KeyPauseCR = Keys.A;
                    break;
                case 2:
                    HS.myPrefs.KeyPauseCR = Keys.B;
                    break;
                case 3:
                    HS.myPrefs.KeyPauseCR = Keys.C;
                    break;
                case 4:
                    HS.myPrefs.KeyPauseCR = Keys.D;
                    break;
                case 5:
                    HS.myPrefs.KeyPauseCR = Keys.E;
                    break;
                case 6:
                    HS.myPrefs.KeyPauseCR = Keys.F;
                    break;
                case 7:
                    HS.myPrefs.KeyPauseCR = Keys.G;
                    break;
                case 8:
                    HS.myPrefs.KeyPauseCR = Keys.H;
                    break;
                case 9:
                    HS.myPrefs.KeyPauseCR = Keys.I;
                    break;
                case 10:
                    HS.myPrefs.KeyPauseCR = Keys.J;
                    break;
                case 11:
                    HS.myPrefs.KeyPauseCR = Keys.K;
                    break;
                case 12:
                    HS.myPrefs.KeyPauseCR = Keys.L;
                    break;
                case 13:
                    HS.myPrefs.KeyPauseCR = Keys.M;
                    break;
                case 14:
                    HS.myPrefs.KeyPauseCR = Keys.N;
                    break;
                case 15:
                    HS.myPrefs.KeyPauseCR = Keys.O;
                    break;
                case 16:
                    HS.myPrefs.KeyPauseCR = Keys.P;
                    break;
                case 17:
                    HS.myPrefs.KeyPauseCR = Keys.Q;
                    break;
                case 18:
                    HS.myPrefs.KeyPauseCR = Keys.R;
                    break;
                case 19:
                    HS.myPrefs.KeyPauseCR = Keys.S;
                    break;
                case 20:
                    HS.myPrefs.KeyPauseCR = Keys.T;
                    break;
                case 21:
                    HS.myPrefs.KeyPauseCR = Keys.U;
                    break;
                case 22:
                    HS.myPrefs.KeyPauseCR = Keys.V;
                    break;
                case 23:
                    HS.myPrefs.KeyPauseCR = Keys.W;
                    break;
                case 24:
                    HS.myPrefs.KeyPauseCR = Keys.X;
                    break;
                case 25:
                    HS.myPrefs.KeyPauseCR = Keys.Y;
                    break;
                case 26:
                    HS.myPrefs.KeyPauseCR = Keys.Z;
                    break;
            }
        }

        private void comboBoxSelectAoe_SelectedIndexChanged(object sender, EventArgs e)
        {
            stopAoeSelect = comboBoxSelectAoe.SelectedIndex;
            switch (stopAoeSelect)
            {
                case 0:
                    HS.myPrefs.KeyStopAoe = Keys.None;
                    break;
                case 1:
                    HS.myPrefs.KeyStopAoe = Keys.A;
                    break;
                case 2:
                    HS.myPrefs.KeyStopAoe = Keys.B;
                    break;
                case 3:
                    HS.myPrefs.KeyStopAoe = Keys.C;
                    break;
                case 4:
                    HS.myPrefs.KeyStopAoe = Keys.D;
                    break;
                case 5:
                    HS.myPrefs.KeyStopAoe = Keys.E;
                    break;
                case 6:
                    HS.myPrefs.KeyStopAoe = Keys.F;
                    break;
                case 7:
                    HS.myPrefs.KeyStopAoe = Keys.G;
                    break;
                case 8:
                    HS.myPrefs.KeyStopAoe = Keys.H;
                    break;
                case 9:
                    HS.myPrefs.KeyStopAoe = Keys.I;
                    break;
                case 10:
                    HS.myPrefs.KeyStopAoe = Keys.J;
                    break;
                case 11:
                    HS.myPrefs.KeyStopAoe = Keys.K;
                    break;
                case 12:
                    HS.myPrefs.KeyStopAoe = Keys.L;
                    break;
                case 13:
                    HS.myPrefs.KeyStopAoe = Keys.M;
                    break;
                case 14:
                    HS.myPrefs.KeyStopAoe = Keys.N;
                    break;
                case 15:
                    HS.myPrefs.KeyStopAoe = Keys.O;
                    break;
                case 16:
                    HS.myPrefs.KeyStopAoe = Keys.P;
                    break;
                case 17:
                    HS.myPrefs.KeyStopAoe = Keys.Q;
                    break;
                case 18:
                    HS.myPrefs.KeyStopAoe = Keys.R;
                    break;
                case 19:
                    HS.myPrefs.KeyStopAoe = Keys.S;
                    break;
                case 20:
                    HS.myPrefs.KeyStopAoe = Keys.T;
                    break;
                case 21:
                    HS.myPrefs.KeyStopAoe = Keys.U;
                    break;
                case 22:
                    HS.myPrefs.KeyStopAoe = Keys.V;
                    break;
                case 23:
                    HS.myPrefs.KeyStopAoe = Keys.W;
                    break;
                case 24:
                    HS.myPrefs.KeyStopAoe = Keys.X;
                    break;
                case 25:
                    HS.myPrefs.KeyStopAoe = Keys.Y;
                    break;
                case 26:
                    HS.myPrefs.KeyStopAoe = Keys.Z;
                    break;
            }
        }

        private void comboBoxSelectCooldown_SelectedIndexChanged(object sender, EventArgs e)
        {
            cooldownSelect = comboBoxSelectCooldown.SelectedIndex;
            switch (cooldownSelect)
            {
                case 0:
                    HS.myPrefs.KeyUseCooldowns = Keys.None;
                    break;
                case 1:
                    HS.myPrefs.KeyUseCooldowns = Keys.A;
                    break;
                case 2:
                    HS.myPrefs.KeyUseCooldowns = Keys.B;
                    break;
                case 3:
                    HS.myPrefs.KeyUseCooldowns = Keys.C;
                    break;
                case 4:
                    HS.myPrefs.KeyUseCooldowns = Keys.D;
                    break;
                case 5:
                    HS.myPrefs.KeyUseCooldowns = Keys.E;
                    break;
                case 6:
                    HS.myPrefs.KeyUseCooldowns = Keys.F;
                    break;
                case 7:
                    HS.myPrefs.KeyUseCooldowns = Keys.G;
                    break;
                case 8:
                    HS.myPrefs.KeyUseCooldowns = Keys.H;
                    break;
                case 9:
                    HS.myPrefs.KeyUseCooldowns = Keys.I;
                    break;
                case 10:
                    HS.myPrefs.KeyUseCooldowns = Keys.J;
                    break;
                case 11:
                    HS.myPrefs.KeyUseCooldowns = Keys.K;
                    break;
                case 12:
                    HS.myPrefs.KeyUseCooldowns = Keys.L;
                    break;
                case 13:
                    HS.myPrefs.KeyUseCooldowns = Keys.M;
                    break;
                case 14:
                    HS.myPrefs.KeyUseCooldowns = Keys.N;
                    break;
                case 15:
                    HS.myPrefs.KeyUseCooldowns = Keys.O;
                    break;
                case 16:
                    HS.myPrefs.KeyUseCooldowns = Keys.P;
                    break;
                case 17:
                    HS.myPrefs.KeyUseCooldowns = Keys.Q;
                    break;
                case 18:
                    HS.myPrefs.KeyUseCooldowns = Keys.R;
                    break;
                case 19:
                    HS.myPrefs.KeyUseCooldowns = Keys.S;
                    break;
                case 20:
                    HS.myPrefs.KeyUseCooldowns = Keys.T;
                    break;
                case 21:
                    HS.myPrefs.KeyUseCooldowns = Keys.U;
                    break;
                case 22:
                    HS.myPrefs.KeyUseCooldowns = Keys.V;
                    break;
                case 23:
                    HS.myPrefs.KeyUseCooldowns = Keys.W;
                    break;
                case 24:
                    HS.myPrefs.KeyUseCooldowns = Keys.X;
                    break;
                case 25:
                    HS.myPrefs.KeyUseCooldowns = Keys.Y;
                    break;
                case 26:
                    HS.myPrefs.KeyUseCooldowns = Keys.Z;
                    break;
            }
        }

        private void comboBoxPlayManual_SelectedIndexChanged(object sender, EventArgs e)
        {
            manualSelect = comboBoxPlayManual.SelectedIndex;
            switch (manualSelect)
            {
                case 0:
                    HS.myPrefs.KeyPlayManual = Keys.None;
                    break;
                case 1:
                    HS.myPrefs.KeyPlayManual = Keys.A;
                    break;
                case 2:
                    HS.myPrefs.KeyPlayManual = Keys.B;
                    break;
                case 3:
                    HS.myPrefs.KeyPlayManual = Keys.C;
                    break;
                case 4:
                    HS.myPrefs.KeyPlayManual = Keys.D;
                    break;
                case 5:
                    HS.myPrefs.KeyPlayManual = Keys.E;
                    break;
                case 6:
                    HS.myPrefs.KeyPlayManual = Keys.F;
                    break;
                case 7:
                    HS.myPrefs.KeyPlayManual = Keys.G;
                    break;
                case 8:
                    HS.myPrefs.KeyPlayManual = Keys.H;
                    break;
                case 9:
                    HS.myPrefs.KeyPlayManual = Keys.I;
                    break;
                case 10:
                    HS.myPrefs.KeyPlayManual = Keys.J;
                    break;
                case 11:
                    HS.myPrefs.KeyPlayManual = Keys.K;
                    break;
                case 12:
                    HS.myPrefs.KeyPlayManual = Keys.L;
                    break;
                case 13:
                    HS.myPrefs.KeyPlayManual = Keys.M;
                    break;
                case 14:
                    HS.myPrefs.KeyPlayManual = Keys.N;
                    break;
                case 15:
                    HS.myPrefs.KeyPlayManual = Keys.O;
                    break;
                case 16:
                    HS.myPrefs.KeyPlayManual = Keys.P;
                    break;
                case 17:
                    HS.myPrefs.KeyPlayManual = Keys.Q;
                    break;
                case 18:
                    HS.myPrefs.KeyPlayManual = Keys.R;
                    break;
                case 19:
                    HS.myPrefs.KeyPlayManual = Keys.S;
                    break;
                case 20:
                    HS.myPrefs.KeyPlayManual = Keys.T;
                    break;
                case 21:
                    HS.myPrefs.KeyPlayManual = Keys.U;
                    break;
                case 22:
                    HS.myPrefs.KeyPlayManual = Keys.V;
                    break;
                case 23:
                    HS.myPrefs.KeyPlayManual = Keys.W;
                    break;
                case 24:
                    HS.myPrefs.KeyPlayManual = Keys.X;
                    break;
                case 25:
                    HS.myPrefs.KeyPlayManual = Keys.Y;
                    break;
                case 26:
                    HS.myPrefs.KeyPlayManual = Keys.Z;
                    break;
            }
        }

        private void checkBox20_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.Bloodfury = checkBox20.Checked;
        }

        private void checkBox21_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.Berserking = checkBox21.Checked;
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.AutoMovement = checkBox1.Checked;
        }

        private void checkBox2_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.AutoTargeting = checkBox2.Checked;
        }

        private void checkBox3_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.AutoFacing = checkBox3.Checked;
        }

        private void checkBox4_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.AutoMovementDisable = checkBox4.Checked;
        }

        private void checkBox5_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.AutoTargetingDisable = checkBox5.Checked;
        }

        private void checkBox6_CheckedChanged(object sender, EventArgs e)
        {
            HS.myPrefs.AutoFacingDisable = checkBox6.Checked;
        }

        private void radioButtonTrinket1Manual_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonTrinket1Manual.Checked) { HS.myPrefs.Trinket1 = 1; }
        }

        private void radioButtonTrinket1CD_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonTrinket1CD.Checked) { HS.myPrefs.Trinket1 = 2; }
        }

        private void radioButtonTrinket1HP_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonTrinket1HP.Checked) { HS.myPrefs.Trinket1 = 3; }
        }

        private void radioButtonTrinket2Manual_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonTrinket2Manual.Checked) { HS.myPrefs.Trinket2 = 1; }
        }

        private void radioButtonTrinket2CD_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonTrinket2CD.Checked) { HS.myPrefs.Trinket2 = 2; }
        }

        private void radioButtonTrinket2HP_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButtonTrinket2HP.Checked) { HS.myPrefs.Trinket2 = 3; }
        }
        

    }
}
